package com.lightjet.macross.base.log.domain;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.lightjet.macross.common.core.IntKeyBaseEntity;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import javax.persistence.Entity;
import javax.persistence.Table;

// 日志索引表

@Entity
@Table(name="LOG_INDEX")
@Getter
@Setter
@NoArgsConstructor
@JsonIgnoreProperties({"hibernateLazyInitializer", "handler","createDate","updateDate"})
public class LogIndex extends IntKeyBaseEntity {

    public static enum LogLevelEnum {
        INFO,//
        WARNING,
        FATAL,//
        OTHER
    }
    // 构造函数
    public LogIndex(Integer id) {
        this.id = id;
    }

    // 日志标题（api说明）
    private String caption;

    // 调用服务名
    private String servicename;

    // 调用API路径
    private String apiuri;

    // 客户端ID
    private String clientid;

    // 请求IP
    private String requestip;

    // 请求方法
    private String method;

    // 请求用户ID
    private String userkey;

    // 请求用户可辨识名称
    private String userdes;

    // 花费时间
    private Long costtime;

    // 请求结果
    private byte result;

    // 调用Controller类
    private String invokeclass;

    // 调用Controller方法
    private String invokemethod;

    // 日志级别
    private LogLevelEnum loglevel;
}
